package com.fenghongzhang.kuaishou.index.home.adapter;


import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.List;
import java.util.Map;
import java.util.TreeMap;

public class HomeViewPagerAdapter extends FragmentPagerAdapter {

    private List<Fragment> list ;
//    private SpannableString spannableString;
//    private List<Integer> tabIcs;
    private static final String TAG = "HomeViewPagerAdapter";

//    private Map<Integer,Fragment> cacheFragmentMap;
//    public HomeViewPagerAdapter(@NonNull FragmentManager fm, List<Fragment> list) {
//        super(fm);
//        this.list = list;
//        cacheFragmentMap = new TreeMap<>();
//    }


    public HomeViewPagerAdapter(@NonNull FragmentManager fm, int behavior, List<Fragment> list) {
        super(fm, behavior);
        this.list = list;
    }

    @NonNull
    @Override
    public Fragment getItem(int position) {
        return list.get(position);
    }

    @Override
    public int getCount() {
        return list.size();
    }

}
